home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / screenblanker / swazblanker26 / install < prev    next >
Text File  |  1995-03-09  |  16KB  |  664 lines

  1. ; $VER: Install 2.5 (25.12.94)
  2. ; Script to install Release 2 SwazBlanker
  3. (complete 0)
  4.  
  5. (set @default-dest "RAM:")
  6. (set @default-popkey "Alt b")
  7. (set @default-blankkey "Alt z")
  8. (set @default-deletablemodules "NO")
  9. (set @default-classdir "SYS:Classes")
  10.  
  11. ;********************************************************************
  12.  
  13. (set #Yes-text
  14. (cat "Yes"
  15. ))
  16.  
  17. (set #No-text
  18. (cat "No"
  19. ))
  20.  
  21. (set #Proceed
  22. (cat     "Proceed"
  23. ))
  24.  
  25. (set #Skip-This-Part
  26. (cat     "Skip this part"
  27. ))
  28.  
  29. ;********************************************************************
  30.  
  31. (set #warn-kickstart-text
  32. (cat    "\nBAD VERSION OF KICKSTART\n\n"
  33.     "SwazBlanker requires KickStart 3.0 (V39) or higher. It will not work on earlier versions.\n"
  34.     "You currently are running KickStart V%ld.\n\n"
  35.     "Continue with installation?"
  36. ))
  37.  
  38. (set #warn-nospace-text
  39. (cat    "\nINSUFFICENT DISK SPACE\n\n"
  40.     "There is insufficient space on device %s: for a full installation of SwazBlanker.\n"
  41.     "\n"
  42.     "Required space : 1000 Kb\n"
  43.     "Available space : %ld Kb\n"
  44.     "\n"
  45.     "Do you want to continue with the installation?"
  46. ))
  47.  
  48. ;********************************************************************
  49.  
  50. (set #path-text
  51. (cat "Where would you like SwazBlanker installed?\n A drawer named 'SwazBlanker' will be created here."
  52. ))
  53.  
  54. (set #path-help
  55. (cat "In this location a drawer will be created. All files except the libraries will be installed inside this drawer. The complete installation will require about 1MB of free disk space.\n\n"
  56.      @askdir-help
  57. ))
  58.  
  59. ;********************************************************************
  60.  
  61. (set #version-checking-text
  62. (cat    "Checking for previously installed SwazBlanker"
  63. ))
  64.  
  65. (set #version-installed-text
  66. (cat    "\nSwazBlanker ALREADY INSTALLED\n"
  67.     "\n"
  68.     "Continue with installation?"
  69. ))
  70.  
  71. ;********************************************************************
  72.  
  73. (set #dirs-build-text
  74. (cat "Building directory structure"
  75. ))
  76.  
  77. ;********************************************************************
  78.  
  79. (set #libs-working-text
  80. (cat "Installing libraries..."
  81. ))
  82.  
  83. (set #libs-installlib-text
  84. (cat "Installing %s..."
  85. ))
  86.  
  87. (set #libs-query-text
  88. (cat "\nInstalling %s\n\n"
  89.      "Version %ld.%ld is currently installed.\n"
  90.      "Would you like to install version %ld.%ld?"
  91. ))
  92.  
  93. (set #libs-help
  94. (cat "It will be necessary to install the most recent available versions "
  95.      "of the libraries required by SwazBlanker for it to function."
  96. ))
  97.  
  98. ;********************************************************************
  99.  
  100. (set #main-copy-text
  101. (cat "Installing SwazBlanker executable"
  102. ))
  103.  
  104. ;********************************************************************
  105.  
  106. (set #module-install-text
  107. (cat "Installing blanker modules"
  108. ))
  109.  
  110. (set #module-which-text
  111. (cat "Which Blankers should be installed?"
  112. ))
  113.  
  114. (set #module-which-help
  115. (cat "Select the blankers you wish to have installed"
  116.      "\n\n" @askoptions-help
  117. ))
  118.  
  119. ;********************************************************************
  120.  
  121. (set #module-install-data-text
  122. (cat "Installing blanker data"
  123. ))
  124.  
  125. ;********************************************************************
  126.  
  127. (set #classes-install-text
  128. (cat "Installing gadget classes"
  129. ))
  130.  
  131. (set #classes-query-text
  132. (cat    "\nINSTALL GADGET CLASSES\n"
  133.     "\nYou need to have the tabs.gadget and textfield.gadget classes installed.\n\n"
  134.     "These should be located in \"" @default-classdir "\" but if you have them "
  135.     "installed somewhere else then you may chose to install them there.\n"
  136.     "\nContinue with installation of gadget classes?"
  137. ))
  138.  
  139. (set #classes-query-help
  140. (cat "These gadget classes are required by several blanker modules. It is recommended that you install them.\n\n"
  141. ))
  142.  
  143. (set #classes-where-text
  144. (cat "Where do the Classes belong?"
  145. ))
  146.  
  147. (set #classes-copy-tabsgadget
  148. (cat "Installing tabs.gadget"
  149. ))
  150.  
  151. (set #classes-copy-textfieldgadget
  152. (cat "Installing textfield.gadget"
  153. ))
  154.  
  155.  
  156. ;********************************************************************
  157.  
  158. (set #lang-install-text
  159. (cat "Installing locale catalogs"
  160. ))
  161.  
  162. (set #lang-which-text
  163. (cat "Which languages should be installed?"
  164. ))
  165.  
  166. (set #lang-which-help
  167. (cat "Check the boxes of the languages you wish to have available with SwazBlanker."
  168.      "\n\n" @askoptions-help
  169. ))
  170.  
  171. ;********************************************************************
  172.  
  173. (set #docs-install-text
  174. (cat "Installing documentation"
  175. ))
  176.  
  177. (set #docs-query-text
  178. (cat "\nWould you like to install full documentation for SwazBlanker?\n\n"
  179.      "This consists of documentation for the main program and all blanker modules and also some"
  180.      " example source code. Also the catalog translation files will also be installed."
  181. ))
  182. (set #docs-query-help
  183. (cat "You may need help or just want to know a bit about SwazBlanker, it is "
  184.      "recommended that you install all documentation."
  185. ))
  186.  
  187. ;********************************************************************
  188.  
  189. (set #prog-install-text
  190. (cat "Installation of programming documentation.\n\n"
  191. ))
  192.  
  193. (set #prog-query-text
  194. (cat    "\nWould you like to install programming files for SwazBlanker?\n\n"
  195.     "This consists of includes, autodocs and a fd file."
  196. ))
  197.  
  198. (set #prog-query-help
  199. (cat    "If you wish to install the include's and fd's select YES otherwise select NO"
  200. ))
  201.  
  202. (set #prog-include-text
  203. (cat    "Please select the directory where your INCLUDE files are stored"
  204. ))
  205. (set #prog-include-help
  206. (cat    "This is wher ethe SwazBlanker includes will be stored\n\n"
  207.          @askdir-help
  208. ))
  209.  
  210. (set #prog-fd-query-text
  211. (cat    "\nWould you like to install the FD file for swazblanker.library?"
  212. ))
  213.  
  214. (set #prog-fd-query-help
  215. (cat    "If you wish to install the fd's select YES otherwise select NO"
  216. ))
  217.  
  218. (set #prog-fd-text
  219. (cat    "Please select the directory where your FD files are stored"
  220. ))
  221.  
  222. (set #prog-fd-help
  223. (cat    "Just set the path to where you keep your fd files!\n\n"
  224.     @askdir-help
  225. ))
  226.  
  227. (set #prog-autodoc-query-text
  228. (cat    "\nWould you like to install the AUTODOC file for swazblanker.library?"
  229. ))
  230.  
  231. (set #prog-autodoc-query-help
  232. (cat    "If you wish to install the autodoc's select YES otherwise select NO"
  233. ))
  234.  
  235. (set #prog-autodoc-text
  236. (cat    "Please select the directory where your AUTODOC files are stored"
  237. ))
  238.  
  239. (set #prog-autodoc-help
  240. (cat    "Just set the path to where you keep your autodoc files!\n\n"
  241.     @askdir-help
  242. ))
  243.  
  244. ;********************************************************************
  245.  
  246. (set #prefs-setup-text
  247. (cat    "Configure the default settings"
  248. ))
  249.  
  250. (set #popkey-text
  251. (cat    "\nYou may now specify the pop key to open the SwazBlanker interface.\n"
  252. ))
  253. (set #popkey-help
  254. (cat    "This key combination will opem the SwazBlanker interface so you may configure SwazBlanker.\n"
  255.     "\nExamples: Alt b, Alt z, Ctrl F1, Shift F10"
  256. ))
  257.  
  258. (set #blankkey-text
  259. (cat    "\nYou may now specify the hot key combination to blank the screen.\n"
  260.     "This should not be the same as you specified for the pop key."
  261. ))
  262.  
  263. (set #blankkey-help
  264. (cat    "This key combination will blank the screen.\n"
  265.     "\nExamples: Alt z, Alt b, Ctrl F1, Shift F10"
  266. ))
  267.  
  268. (set #deletablemodules-text
  269. (cat    "\nWould you like to enable the DEL key to be able to delete"
  270.     " the modules from your disk."
  271. ))
  272.  
  273. (set #deletablemodules-help
  274. (cat    "Pressing DEL with a module hilighted in the SwazBlanker preferences will"
  275.     " delete the module from your disk (you will be prompted to confirm this)."
  276. ))
  277.  
  278. (set #prefs-writing-tooltypes-text
  279. (cat    "Writing tooltypes"
  280. ))
  281.  
  282. ;********************************************************************
  283.  
  284. (set #pos-icons-text
  285. (cat "Positioning icons"
  286. ))
  287.  
  288. ;********************************************************************
  289.  
  290. (set #goodbye
  291. (cat "\nPlease remember that SwazBlanker is SHAREWARE.\n\n"
  292.      "If you use this program you should register by sending $10 US ($20 NZ) to:\n\n"
  293. ))
  294.  
  295. (set #my-address
  296. (cat    "David Swasbrook,\n"
  297.     "PO Box 54134,\n"
  298.     "Bucklands Beach,\n"
  299.     "Auckland,\n"
  300.     "NEW ZEALAND.\n"
  301. ))
  302.  
  303. ;********************************************************************
  304. ;**** END OF TEXT
  305. ;********************************************************************
  306.  
  307.  
  308. ;********************************
  309. ;**** CHECK THE KICKSTART VERSION
  310. ;****
  311. (set ver (/ (getversion) 65536) )
  312. (if (< ver 39) (
  313.     (set warning (#warn-kickstart-text ver) ) (message warning)
  314. ))
  315.  
  316. ;******************************
  317. ;**** CHECK THE DESTINATION DIR
  318. ;****
  319. (set target
  320. (askdir (prompt #path-text) (help #path-help) (default @default-dest) (newpath)
  321. ))
  322. (set target (tackon target "SwazBlanker"))
  323. (set devname (getdevice target))
  324.  
  325. (if (NOT (= "RAM"  devname) )    (
  326.     (set space (/ (getdiskspace (cat devname ":")) 1024) )
  327.     (if (> 1000 space) ( (set warning (#warn-nospace-text devname space) ) (message warning) )
  328.     )
  329. ))
  330.  
  331. ;******************************
  332. ;**** LOOK FOR OLD VERSION
  333. ;****
  334. (complete 5) (working #version-checking-text)
  335.  
  336. (if (exists (tackon target "SwazBlanker")) (
  337.     (set warning (#version-installed-text ) ) (message warning)
  338. ))
  339.  
  340. (set @default-dest target)
  341.  
  342. ;******************************
  343. ;**** SETUP DIRECTORIES
  344. ;****
  345.  
  346. (complete 10) (working #dirs-build-text)
  347. (complete 11) (makedir (infos) target)
  348. (complete 12) (makedir (tackon target "blankers"))        
  349. (complete 13) (makedir (tackon target "blankers/data"))
  350. (complete 14) (makedir (tackon target "docs"))
  351. (complete 15) (copyfiles (source "") (dest target) (choices "blankers.info" "docs.info") )
  352. (complete 16) (copyfiles (source "blankers") (dest (tackon target "blankers")) (choices "data.info") )
  353.  
  354.  
  355.  
  356.  
  357. ;******************************
  358. ;**** INSTALL LIBRARIES
  359. ;****
  360. (complete 20) (working #libs-working-text)
  361.  
  362. (procedure INSTALLLIB
  363.  
  364. (set warning (#libs-installlib-text libname ))
  365. (working warning)
  366.  
  367. (set Version (getversion (tackon "misc/libs" libname)) )
  368. (set newVer (/ Version 65536))
  369. (set newRev (- Version (* newVer 65536)))
  370.  
  371. (set Version (getversion (tackon "libs:" libname) ))
  372. (if (= Version 0)
  373.     (
  374.         (set instlib 1)    
  375.     )
  376.  
  377.     (
  378.         (set oldVer (/ Version 65536))
  379.         (set oldRev (- Version (* newVer 65536)))
  380.  
  381.         (set instlib 0)
  382.         (set verify 0)
  383.  
  384.         (if(< oldVer newVer)
  385.             (set verify 1)
  386.         )
  387.     
  388.         (if(= oldVer newVer)
  389.             (if (< oldRev newRev)
  390.                 (set verify 1)
  391.               )
  392.         )
  393.  
  394.         (if(= verify 1)
  395.         (    (set warning (#libs-query-text libname oldVer oldRev newVer newRev))
  396.             (set instlib (askbool (prompt warning) (help #libs-help)) )
  397.         ))
  398.     )
  399. )
  400.  
  401. (if instlib
  402.     (copyfiles (prompt "Copying " libname ) (help @copyfiles-help)
  403.         (source (tackon "misc/libs" libname) ) (dest "libs:") (choices libname )
  404. ))
  405.  
  406. )
  407.  
  408. (complete 21)    (set libname "swazblanker.library")    (INSTALLLIB)
  409. (complete 23)    (set libname "matrix.library")    (INSTALLLIB)
  410.  
  411.  
  412. ;******************************
  413. ;**** GADGET CLASSES
  414. ;****
  415. (complete 25) (working #classes-install-text)
  416.  
  417. (if
  418. (=
  419.   (askbool (prompt #classes-query-text) (help #classes-query-help) (choices #Proceed #Skip-This-Part) )
  420.   1)
  421.  
  422. (
  423.  
  424. (set classdir
  425. (askdir    (prompt #classes-where-text )
  426.     (help @askdir-help )
  427.     (default @default-classdir )
  428. ))
  429.  
  430. (complete 27)
  431.  
  432. (copylib
  433.     (prompt #classes-copy-tabsgadget )
  434.     (help @copylib-help)
  435.     (source "misc/gadgets/tabs.gadget")
  436.     (dest (tackon classdir "Gadgets"))
  437.     (confirm)
  438. )
  439.  
  440. (complete 29)
  441.  
  442. (copylib
  443.     (prompt #classes-copy-textfieldgadget )
  444.     (help @copylib-help)
  445.     (source "misc/gadgets/textfield.gadget")
  446.     (dest (tackon classdir "Gadgets"))
  447.     (confirm)
  448. )
  449.  
  450. ))
  451.  
  452. ;******************************
  453. ;**** COPY MAIN PROGRAM
  454. ;****
  455.  
  456. (complete 30) (working #main-copy-text)
  457. (copyfiles (prompt "Copying to " #target ) (help @copyfiles-help) (source "") (dest (cat target) )
  458.     (choices "SwazBlanker" "SwazBlanker.info" )
  459. )
  460.  
  461.  
  462.  
  463. ;******************************
  464. ;**** COPY BLANKER MODULES
  465. ;****
  466. (complete 35) (working #module-install-text)
  467.  
  468. (copyfiles
  469.     (prompt #module-which-text)
  470.     (help #module-which-help)
  471.     (source "blankers/" )
  472.     (dest (tackon target "blankers" ) )
  473.     (pattern "~#?.info")
  474.     (files )
  475.     (infos )
  476.     (optional "nofail")
  477. )
  478.  
  479. ;******************************
  480. ;**** COPY MODULE DATA
  481. ;****
  482.  
  483. (complete 50) (working #module-install-data-text)
  484.  
  485. (complete 51) (if (exists (tackon target "blankers/headlines"))
  486.     (    (copyfiles
  487.             (prompt    #ask-blankers)
  488.             (help    #ask-blankers-help)
  489.             (source    "blankers/data/headlines" )
  490.             (dest    (tackon target "blankers/data/headlines"))
  491.             (all)
  492.         )
  493.         (copyfiles
  494.             (prompt    #ask-blankers)
  495.             (help    #ask-blankers-help)
  496.             (source    "blankers/data" )
  497.             (dest    (tackon target "blankers/data"))
  498.             (choices    "headlines.info")
  499.         )
  500.     )
  501. )
  502.  
  503. (complete 56) (if(exists (tackon target "blankers/quotes") )
  504.     (    (copyfiles
  505.             (prompt    #ask-blankers)
  506.             (help    #ask-blankers-help)
  507.             (source    "blankers/data/quotes" )
  508.             (dest    (tackon target "blankers/data/quotes"))
  509.             (all)
  510.         )
  511.         (copyfiles (prompt #ask-blankers) (help #ask-blankers-help)
  512.             (source "blankers/data" ) (dest (tackon target "blankers/data"))
  513.             (choices    "quotes.info")
  514.         )
  515.     )
  516. )
  517.  
  518.  
  519.  
  520. ;******************************
  521. ;**** LOCALE
  522. ;****
  523.  
  524. (set def-lang 0)
  525.  
  526. (complete 60) (working #lang-install-text)
  527.  
  528. (set lang
  529. (askoptions (prompt #lang-which-text) (help #lang-which-help) (default def-lang)
  530.         (choices "suomi")
  531. ))
  532.  
  533. (complete 63)
  534. (if lang (
  535.     (set n 0)
  536.     (while    (set language
  537.         (select n "suomi" ""
  538.         ))
  539.     (
  540.         (if (IN lang n) (
  541.                 (makedir (cat "LOCALE:catalogs/" language  ) )
  542.                 (makedir (cat "LOCALE:catalogs/" language "/matrix" ) )
  543.                 (makedir (cat "LOCALE:catalogs/" language "/matrix/swazblanker" ) )
  544.                 (copyfiles
  545.                     (source (cat "misc/catalogs/" language ) )
  546.                     (dest (cat "LOCALE:catalogs/" language "/matrix/swazblanker" ) )
  547.                     (pattern "#?")
  548.                     (optional "nofail")
  549.                 )
  550.                   )
  551.         )
  552.         (set n (+ n 1))
  553.     ))
  554. ))
  555.  
  556.  
  557. ;******************************
  558. ;**** DOCUMENTATION
  559. ;****
  560. (complete 65) (working #docs-install-text)
  561.  
  562. (if(= (askbool (prompt #docs-query-text) (help #docs-query-help)) 1)
  563.     (copyfiles (source "docs/") (dest (tackon target "docs" ) ) (infos) (all)
  564.     )
  565. )
  566.  
  567.  
  568. ;******************************
  569. ;**** INCLUDES
  570. ;****
  571.  
  572. (complete 70) (working #prog-install-text)
  573.  
  574. (if(= (askbool (prompt #prog-query-text) (help #prog-query-help)) 1)
  575. (
  576.     (set Path
  577.     (askdir (prompt #prog-include-text) (help #prog-include-help) (default "Include:") (newpath)
  578.     ))
  579.  
  580.     (copyfiles (source "misc/include") (dest Path ) (all)
  581.     )
  582.  
  583.     (complete 75)
  584.  
  585.     (if(= (askbool (prompt #prog-fd-query-text) (help #prog-fd-query-help)) 1)
  586.     (
  587.         (set Path
  588.         (askdir (prompt #prog-fd-text) (help #prog-fd-help) (default "fd:") (newpath)
  589.         ))
  590.         (copyfiles (source "misc") (dest Path ) (choices "SwazBlanker_lib.fd")
  591.         )
  592.     ))
  593.  
  594.     (complete 77)
  595.  
  596.     (if(= (askbool (prompt #prog-autodoc-query-text) (help #prog-autodoc-query-help)) 1)
  597.     (
  598.         (set Path
  599.         (askdir (prompt #prog-autodoc-text) (help #prog-autodoc-help) (default "autodoc:") (newpath)
  600.         ))
  601.         (copyfiles (source "misc") (dest Path) (choices "SwazBlanker.doc")
  602.         )
  603.     ))
  604.  
  605. ))
  606.  
  607. ;******************************
  608. ;**** TOOL TYPES
  609. ;****
  610.  
  611. (complete ) (working #prefs-setup-text)
  612.  
  613. (complete 80)
  614. (set cxPopKey
  615. (askstring (prompt #popkey-text) (help #popkey-help) (default @default-popkey)
  616. ))
  617.  
  618. (complete 84)
  619. (set cxBlankKey
  620. (askstring (prompt #blankkey-text) (help #blankkey-help) (default @default-blankkey)
  621. ))
  622.  
  623.  
  624. (complete 88)
  625. (if(= (askbool (prompt #deletablemodules-text) (help #deletablemodules-help) (choices #Yes-text #No-text) (default 0) ) 1)
  626.     (
  627.         (set tooltype_deletablemodules (cat "YES")
  628.         )
  629.     )
  630. )
  631.  
  632.  
  633. (complete 90) (working #prefs-writing-tooltypes-text)
  634.  
  635. (tooltype    (dest (tackon target "SwazBlanker") )
  636.     (settooltype "DELETABLEMODULES" tooltype_deletablemodules )
  637.     (settooltype "DEFBLANKERPATH" (cat "\"" (tackon target "blankers") "\"") )
  638.     (settooltype "DOCPATH" (cat "\"" (tackon target "docs") "\"") )
  639.     (settooltype "HELPFILE" (cat "\"SwazBlanker.guide\"") )
  640.     (settooltype "CX_POPKEY" cxPopKey )
  641.     (settooltype "BLANKKEY" cxBlankKey )
  642.     (settooltype "DONOTWAIT" )
  643.     (settooltype "CX_POPUP" "NO" )
  644.     (settooltype "CX_PRIORITY" "0" )
  645. )
  646.  
  647. ;******************************
  648. ;**** POSITIONING ICONS
  649. ;****
  650.  
  651. (procedure UNSNAPICONS
  652.     (foreach unsnap "#?" (tooltype (dest (tackon unsnap @each-name) ) (noposition) )
  653.     )
  654. )
  655.  
  656. (complete 95)    (working #pos-icons-text)
  657. (complete 96)    (set unsnap target)            (UNSNAPICONS)
  658. (complete 97)    (set unsnap (tackon target "docs"))    (UNSNAPICONS)
  659. (complete 98)    (set unsnap (tackon target "blankers"))    (UNSNAPICONS)
  660. (complete 99)    (set unsnap (tackon target "blankers/data")) (UNSNAPICONS)
  661.  
  662. (complete 100) (message #goodbye #my-address)
  663.  
  664.